<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="objetivosPersonal" styleClass="edit">

        <rich:panel style="width:400px">
            <f:facet name="header">#{objetivosPersonalHome.managed ? 'Edit' : 'Add'} Objetivos personal</f:facet>



            <s:decorate id="publPersObjField" template="layout/edit.xhtml">
                <ui:define name="label">Publicaciones</ui:define>
                <h:inputText id="publPersObj"
                          value="#{objetivosPersonalHome.instance.publPersObj}">
                    <a:support event="onblur" reRender="publPersObjField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="confPersObjField" template="layout/edit.xhtml">
                <ui:define name="label">Conferencias</ui:define>
                <h:inputText id="confPersObj"
                          value="#{objetivosPersonalHome.instance.confPersObj}">
                    <a:support event="onblur" reRender="confPersObjField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="herrPersObjField" template="layout/edit.xhtml">
                <ui:define name="label">Herramientas</ui:define>
                <h:inputText id="herrPersObj"
                          value="#{objetivosPersonalHome.instance.herrPersObj}">
                    <a:support event="onblur" reRender="herrPersObjField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="transPersObjField" template="layout/edit.xhtml">
                <ui:define name="label">Transferencia</ui:define>
                <h:inputText id="transPersObj"
                          value="#{objetivosPersonalHome.instance.transPersObj}">
                    <a:support event="onblur" reRender="transPersObjField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="colabPersObjField" template="layout/edit.xhtml">
                <ui:define name="label">Colaboraciones</ui:define>
                <h:inputText id="colabPersObj"
                          value="#{objetivosPersonalHome.instance.colabPersObj}">
                    <a:support event="onblur" reRender="colabPersObjField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="proyPersObjField" template="layout/edit.xhtml">
                <ui:define name="label">Proyectos</ui:define>
                <h:inputText id="proyPersObj"
                          value="#{objetivosPersonalHome.instance.proyPersObj}">
                    <a:support event="onblur" reRender="proyPersObjField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="idPersonalRedmineField" template="layout/edit.xhtml" rendered="false">
                <ui:define name="label">Id personal redmine</ui:define>
                <h:inputText id="idPersonalRedmine"
                          value="#{objetivosPersonalHome.instance.idPersonalRedmine}">
                    <a:support event="onblur" reRender="idPersonalRedmineField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Guardar"
                         action="#{objetivosPersonalHome.persist}"
                       disabled="#{!objetivosPersonalHome.wired}"
                       rendered="#{!objetivosPersonalHome.managed}"/>

            <h:commandButton id="update"
                          value="Guardar"
                         action="#{objetivosPersonalHome.update}"
                       rendered="#{objetivosPersonalHome.managed}"/>

            <h:commandButton id="delete"
                          value="Borrar todo"
                         action="#{objetivosPersonalHome.remove}"
                      immediate="true"
                       rendered="#{objetivosPersonalHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancelar"
             propagation="end"
                    view="/ObjetivosPersonal.xhtml"
                rendered="#{objetivosPersonalHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancelar"
             propagation="end"
                    view="/#{empty objetivosPersonalFrom ? 'ObjetivosPersonalList' : objetivosPersonalFrom}.xhtml"
                rendered="#{!objetivosPersonalHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax" rendered="false">

    <rich:tab label="Objetivoses">
        <h:form styleClass="association" id="objetivosesChildren">

            <h:outputText value="There are no objetivoses associated with this objetivosPersonal."
                       rendered="#{empty objetivosPersonalHome.objetivoses}"/>

            <rich:dataTable value="#{objetivosPersonalHome.objetivoses}"
                           var="_objetivos"
                      rendered="#{not empty objetivosPersonalHome.objetivoses}"
                    rowClasses="rvgRowOne,rvgRowTwo"
                            id="objetivosesTable">
                <rich:column sortBy="#{_objetivos.idObjetivos}">
                    <f:facet name="header">Id objetivos</f:facet>
                    <h:outputText value="#{_objetivos.idObjetivos}"/>
                </rich:column>
            </rich:dataTable>

        </h:form>

        <f:subview rendered="#{objetivosPersonalHome.managed}" id="objetivoses">
        <div class="actionButtons">
            <s:button id="addobjetivos"
                   value="Add objetivos"
                    view="/ObjetivosEdit.xhtml"
             propagation="none">
                 <f:param name="objetivosPersonalIdObjetivosPersonal"
                         value="#{objetivosPersonalHome.instance.idObjetivosPersonal}"/>
                 <f:param name="objetivosFrom" value="ObjetivosPersonal"/>
            </s:button>
        </div>
        </f:subview>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
